#include "contacts.pb.h"
#include <iostream>

using namespace contacts;

int main()
{
    contact request;
    request.set_sn(100);
    request.set_score(11.1);
    request.set_name("小王");
    std::string str = request.SerializeAsString();

    contacts::contact response;
    int ok = response.ParseFromString(str);
    if(!ok)
    {
        std::cout << "反序列化失败\n";
        return 0;
    }
    std::cout << response.sn() << std::endl;
    std::cout << response.name() << std::endl;
    std::cout << response.score() << std::endl;

    return 0;
}
